<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateIntegrallogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integrallogs', function (Blueprint $table) {
            $table->id()->comment('积分日志表');
            $table->string('title')->default('sign')->comment('标题:(sign:签到赠送积分 luck_draw:抽奖使用积分 order:下单赠送积分 purchase_goods:购买商品赠送积分)');
            $table->string('user_id')->comment('用户id');
            $table->string('front_integral')->comment('变动前积分');
            $table->string('get_points')->comment('积分变动');
            $table->string('type')->comment('变动类型：0为支出 1为增加');
            $table->string('remarks')->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('integrallogs');
    }
}
